package leetcode100;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author shkstart
 * @create 2023-01-02-23:24
 */
public class Meme31_1 {

        private static List<String> factorization(int a) {
            List<String> ans = new ArrayList<>();
            for (int i = 2; a > 1 && i * i <= a; i++) {
                while (a % i == 0) {
                    ans.add(String.valueOf(i));
                    a = a / i;
                }
            }
            if (a > 1) {
                ans.add(String.valueOf(a));
            }
            return ans;
        }

        public static void main(String[] args) {
            Scanner s = new Scanner(System.in);
            while (s.hasNextInt()) {
                int a = s.nextInt();
                List<String> factors = factorization(a);
                System.out.printf("%d = %s\n", a, String.join(" * ", factors));
            }

    }}
